-
Notifications
You must be signed in to change notification settings - Fork 341
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use a formatter for assert_email_delivered_with/1
#482
Use a formatter for assert_email_delivered_with/1
#482
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👋 @drapergeek Thanks for this! I believe this also resolves #444. Think it's worth it to also add something to the documentation about this?
@@ -54,6 +54,7 @@ defmodule Bamboo.TestAdapterTest do | |||
end | |||
|
|||
sent_email |> TestMailer.deliver_now() | |||
assert_email_delivered_with(from: "foo@bar.com") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It took me a second to understand this test, and I was wondering about the idea of having it be its own (named) test, but this does follow the existing pattern of including all of these within the same test about the helpers, so maybe making changes to it would be a separate issue? Thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not a huge fan of this style, but I wasn't going to fight against the current standard. I don't have a strong opinion in favor of changing it but I would say it's a separate issue.
Hi @maymillerricci 👋! Thanks for the review, will happily add some documentation! Yes, this will resolve #444 |
8b30f95
to
6c3b0c2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! Just one tiny typo. 👍
@@ -182,6 +182,12 @@ defmodule Bamboo.Test do | |||
unsent_email = Bamboo.Email.new_email(subject: "something else") | |||
assert_email_delivered_with(subject: "something else") # Will fail | |||
|
|||
The function will use the Bamboo Formatter when checking email addresse.s |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The function will use the Bamboo Formatter when checking email addresse.s | |
The function will use the Bamboo Formatter when checking email addresses. |
Merged in 73592c5. Thanks for this! |
This should make it a bit easier to test emails without needing to use the specific format that bamboo uses.